home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / util / boot / SuperPass20b.lha / reboot.lzx / REBOOT.S < prev    next >
Text File  |  1995-06-15  |  2KB  |  139 lines

  1.  
  2. _AbsExecBase      EQU   4
  3. _LVOOpenLibrary   EQU   -$0228
  4. _LVOCloseLibrary  EQU   -$019e
  5. _LVOColdReboot    EQU   -$02d6
  6.  
  7. _LVODelay         EQU   -$00c6
  8. _LVOReadArgs      EQU   -$031e
  9. _LVOFreeArgs      EQU   -$035a
  10. _LVOEasyRequestArgs EQU -$024c
  11.  
  12.  
  13.  
  14.    lea      dosName(PC),A1
  15.    move.l   #36,D0
  16.    move.l   _AbsExecBase,A6
  17.    jsr      _LVOOpenLibrary(A6)
  18.    move.l   d0,_DosBase
  19.    beq      ExitError
  20.  
  21.    lea      intuitionName(PC),A1
  22.    move.l   #36,D0
  23.    jsr      _LVOOpenLibrary(A6)
  24.    move.l   d0,_IntuitionBase
  25.    beq      ExitError
  26.  
  27.    move.l   #argTemplate,d1
  28.    move.l   #argArray,d2
  29.    moveq    #0,d3
  30.    movea.l  _DosBase,a6
  31.    jsr      _LVOReadArgs(a6)
  32.    move.l   d0,rdArgs
  33.    beq      ExitError
  34.  
  35.    tst.l    argForce
  36.    bne.s    5$
  37.  
  38.    bsr      Asegurar
  39.    tst.l    D0
  40.    bne.s    5$
  41.  
  42.    bsr      CloseAll
  43.  
  44.    moveq    #0,d0
  45.    rts
  46.  
  47. 5$:
  48.    move.l   #12,D1
  49.    movea.l  _DosBase,A6
  50.    jsr      _LVODelay(A6)   ; Esperar medio segundo
  51.  
  52.  
  53.    move.l   _AbsExecBase,A6
  54.    jsr      _LVOColdReboot(A6) ; Resetear sistema
  55.  
  56.  
  57. Asegurar
  58.    suba.l   A0,A0
  59.    lea      easy,A1
  60.    suba.l   A2,A2
  61.    suba.l   A3,A3
  62.    move.l   _IntuitionBase,A6
  63.    jsr      _LVOEasyRequestArgs(A6) ; Sacar requester con confirmación
  64.    rts
  65.  
  66.  
  67.    dc.b     '$VER: reboot 1.2 By Ramírezoft (26.12.92)',0 ; Version string
  68.    even
  69.  
  70. ExitError
  71.     bsr     CloseAll
  72.     move.l  #20,d0
  73.     rts
  74.  
  75. CloseAll
  76.     move.l  rdArgs,d1
  77.     beq     \IntuitionLib
  78.     movea.l _DosBase,a6
  79.     jsr     _LVOFreeArgs(a6)
  80. \IntuitionLib
  81.     tst.l   _IntuitionBase
  82.     beq     \DosLib
  83.     movea.l _IntuitionBase,a1
  84.     movea.l _AbsExecBase,a6
  85.     jsr     _LVOCloseLibrary(a6)
  86. \DosLib
  87.     tst.l   _DosBase
  88.     beq     \EndCloseAll
  89.     movea.l _IntuitionBase,a1
  90.     movea.l _AbsExecBase,a6
  91.     jsr     _LVOCloseLibrary(a6)
  92. \EndCloseAll
  93.     rts
  94.  
  95. argTemplate
  96.     dc.b    "FORCE/S",0
  97.     even
  98.  
  99. argArray
  100. argForce
  101.    dc.l     0
  102.  
  103. rdArgs
  104.    dc.l     0
  105.  
  106.  
  107. easy:
  108.    dc.l     20,0       ; es_StructSize, es_Flags
  109.    dc.l     0          ; es_Title
  110.    dc.l     easyText   ; es_TextFormat
  111.    dc.l     easyGadget ; es_GadgetFormat
  112.  
  113. easyText:
  114.    dc.b     'Do you wish to reboot the system?',10,10
  115.    dc.b     '(Suspend ALL disk activity)',0
  116.    even
  117.  
  118. easyGadget:
  119.    dc.b     'Yes|No',0
  120.    even
  121.  
  122. dosName:
  123.    dc.b     'dos.library',0
  124.    even
  125.  
  126. intuitionName:
  127.    dc.b     'intuition.library',0
  128.    even
  129.  
  130.  
  131.  
  132. _DosBase:
  133.    dc.l     0
  134.  
  135. _IntuitionBase
  136.    dc.l     0
  137.  
  138.    end
  139.